<?php include $this->admin_tpl('meta');?>
<title>添加岗位</title>
<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/laydate/1.1/laydate.js"></script>
<script type="text/javascript" charset="utf-8" src="<?php echo STATIC_URL;?>plugin/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="<?php echo STATIC_URL;?>plugin/ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="<?php echo STATIC_URL;?>plugin/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<body>
<article class="page-container">
<div class="formdoby_normal"> 
	<form method="post" onsubmit="return dosub(this)">
		<ul>
			 <li>
			 <label><span class="c-red">*</span>部门：</label>
			 <select  name="department_id" size="1">
				<option value="">请选择部门</option>
			    <?php echo $select_menus;?>			
			 </select>
			 </li>		
			 <li>
			 	<label><span class="c-red">*</span>岗位名称：</label>
			 	<input type="text" class="input" placeholder="岗位名称" name="name" value="">
			 </li>
			 <li>
			 <label><span class="c-red">*</span>年假天数：</label>
			 <select  name="leave_days" size="1">
				<option value="">选择年假天数</option>
				<option value="0">0天</option>
				<option value="3">3天</option>
				<option value="5">5天</option>
			 </select>
			 </li>	
			 <li><label><span class="c-red">*</span>是否启用：</label>
			 <span class="span_input">
			 	<label class="label_radio"><input name="status" type="radio" value="1"> 是</label>
			 	<label class="label_radio"><input name="status" type="radio" value="0"> 否</label>
			 </span>
			 </li>
			 <li><label><span class="c-red"></span>岗位招聘要求：</label></li>
			 <li>
			 <?php echo form::editor('text', '', 'width:100%;height:250px', false);?>
			 </li>
		</ul>
		<div class="footer_btn">
			<input type="hidden" name="dosubmit" value="1">
			<input class="btn btn-primary radius" type="submit" value="提 交">
			<input class="btn btn-default radius" type="button" value="取 消" onclick="yzmcms_close()">	
		</div>
	</form>
</div>
</article>
<?php include $this->admin_tpl('footer');?>

<script type="text/javascript">
	function dosub(obj){
		 if(obj.department_id.value==''){
			 layer.msg('请选择部门！');
			 return false;
		 }
		 if(obj.name.value==''){
			 layer.msg('部门名称不能为空！');
			 return false;
		 }
		 if(obj.leave_days.value==''){
			 layer.msg('请选择年假天数！');
			 return false;
		 }
		 /*if(obj.position.value==''){
			 layer.msg('部门岗位不能为空！');
			 return false;
		 }*/
        $.ajax({
            type: 'POST',
            url: '<?php echo U('add');?>', 
            data: $(obj).serialize(),
		    dataType: "json", 
            success: function (msg) {
				if(msg.status == 1){
					layer.msg(msg.message, {icon:1,time:1500}, function(){
						parent.location.reload();     
					});
			    }else{
					layer.msg(msg.message, {icon:2});
				}
            }
        })		 
		return false;			 
	}
</script> 

</body>
</html>